<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted Access');
 
// load tooltip behavior
JHtml::_('behavior.tooltip');
$editor =& JFactory::getEditor();
?>
<form action="<?php echo JRoute::_('index.php?option=com_shop'); ?>"   method="post" name="adminForm" enctype="multipart/form-data">
<div class="width-60 fltlft">
		<fieldset class="adminform">
			<legend>Nhập thông tin Banner</legend>
			<ul class="adminformlist">
				<li><label id="title" for="" class="required" title="">Tiêu đề Banner<span class="star">&nbsp;*</span></label>
                <input type="text" name="title" id="title" value="<?php echo $this->item->title; ?>" class="inputbox required" size="50" aria-required="true" required="required"></li>
                <li>
                <label id="state" for="state">Bật</label>
			<select name="state" class="inputbox">
				<option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option>
				<?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->item->state, true);?>
			</select>
                </li>
                <li>
                <label>Ngày bắt đầu</label>
                <?php echo JHTML::_('calendar',date('d-m-Y',$this->item->datestart), 'datestart', 'datestart', "%d-%m-%Y"); ?>
                </li>
                 <li>
                <label>Ngày kết thúc</label>
                <?php echo JHTML::_('calendar',date('d-m-Y',$this->item->dateend), 'dateend', 'dateend', "%d-%m-%Y"); ?>
                </li>
			</ul>
             <div class="clr"></div>
            <?php 
			echo $editor->display('desc', $this->item->desc , '100%', '400', '60', '20', true);
			?>
		</fieldset>
</div>
<input type="hidden" name="task" value="" />
<input type="hidden" name="id" value="<?php echo $this->item->id; ?>" />
<input type="hidden" name="ordering" value="<?php echo $this->item->ordering; ?>" />

<?php echo JHtml::_('form.token'); ?>
</form>
<script>
Joomla.submitbutton = function(task)
{
	var frm = document.adminForm;
	if (task == '')
	{
		return false;
	}
	else
	{
		var isValid=true;
		var action = task.split('.');
		if (action[1] != 'cancel' && action[1] != 'close')
		{
			if(frm.title.value == ''){
				alert('Nhập tiêu đề banner cần đăng');
				frm.title.focus();
				return false;
			}
			else{
				Joomla.submitform(task);
				return true;
			}
		}
		else{
			Joomla.submitform(task);
			return true;
		}

	}
}

</script>